.TH std::filesystem::directory_entry::directory_entry 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::filesystem::directory_entry::directory_entry \- std::filesystem::directory_entry::directory_entry

.SH Synopsis
   directory_entry() noexcept = default;                              \fB(1)\fP \fI(since C++17)\fP
   directory_entry( const directory_entry& ) = default;               \fB(2)\fP \fI(since C++17)\fP
   directory_entry( directory_entry&& ) noexcept = default;           \fB(3)\fP \fI(since C++17)\fP
   explicit directory_entry( const std::filesystem::path& p );        \fB(4)\fP \fI(since C++17)\fP
   directory_entry( const std::filesystem::path& p, std::error_code&  \fB(5)\fP \fI(since C++17)\fP
   ec );

   Constructs a new directory_entry object.

   1) Default constructor.
   2) Defaulted copy constructor.
   3) Defaulted move constructor.
   4,5) Initializes the directory entry with path p and calls refresh to update the
   cached attributes. If an error occurs, the non-throwing overload leaves the
   directory_entry holding a default-constructed path.

.SH Parameters

   p  - path to the filesystem object to which the directory entry will refer
   ec - out-parameter for error reporting in the non-throwing overload

.SH Exceptions

   Any overload not marked noexcept may throw std::bad_alloc if memory allocation
   fails.

   1-4) Throws std::filesystem::filesystem_error on underlying OS API errors,
   constructed with p as the first path argument and the OS error code as the error
   code argument.
   5) Sets a std::error_code& parameter to the OS API error code if an OS API call
   fails, and executes ec.clear() if no errors occur.

.SH Example

    This section is incomplete
    Reason: no example

.SH Category:
     * Todo no example
